import request from '../../utils/request'

/**
 * 新增费用项
 * 
 */
export async function addFeeItem(data) {
    return request(apiPath.mc + "/api/feeItem", {
        method: 'post',
        data
    });
}


/**
 * 更新费用项
 *
 */
export async function updateFeeItem(data) {
    return request(apiPath.mc + "/api/feeItem", {
        method: 'put',
        data
    });
}

/**
 * 根据id删除费用项
 * 
 */
export async function deleteFeeItemById({ id }) {
    return request(apiPath.mc + "/api/feeItem/" + id, {
        method: 'delete'
    });
}

/**
 *获取供应商费用项
 *
 */
export async function getFeeItemById({ id }) {
    return request(apiPath.mc + "/api/feeItem/" + id, {
        method: 'get'
    });
}


/**
 * 分页查询费用项
 * 
 */
export async function getListForPage({ feeItem, type, lesseeCode, page }) {
    return request(apiPath.mc + "/api/feeItem", {
        method: 'get',
        data: {  feeItem, type, lesseeCode, page: page.page, size: page.size }
    });
}

/**
 * 查询租户下所有未删除的费用项
 *
 */
export async function getAllFeeItems({type}) {
    return request(apiPath.mc + "/api/feeItem/all", {
        method: 'get',
        data: {type}
    });
}


